1. Field of the Invention
The present invention relates generally to real-time packet reception, and in particular, to an apparatus and method for providing real-time data to an application by enabling a socket buffer to retain the latest data at all times.
2. Description of the Related Art
FIG. 1 shows a protocol stack structure for packet transmission/reception. The following description is made in the context of Internet Protocol (IP) packets.
Referring to FIG. 1, in a general IP packet transmission mechanism, a receiver receives and queues packets, which are transmitted from a transmitter, in the order of arrival irrespective of the order of transmission. The packets arc processed in a TCP (Transmission Control Protocol)/UDP (User Datagram Protocol)/RAW layer 120. The processed packets are queued in a socket layer interface (SLI) 130 (i.e., a socket buffer) according to the queuing order. The queued packets arc transmitted to the corresponding applications 140.
If the socket buffer is full of packets, a received packet is not queued but discarded according to a “drop-tail” policy.
FIG. 2 illustrates a process for storing data in the socket buffer.
Referring to FIG. 2, data are stored in the socket buffer according to a FIFO (First In First Out) scheme in which the first data to arrive is the first to leave.
FIG. 3 illustrates a process for loading data from the socket buffer.
Referring to FIG. 3, because the socket buffer uses a FIFO scheme as illustrated in FIG. 2, the latest data are last loaded from the socket buffer and vice versa.
The socket buffer operates well in correspondence with general applications. A security application requires real-time transmission of changed key data. However, if the security application is used together with a program that adds a large traffic load to an IP protocol stack, it is difficult to transmit the changed key data in real time.
In addition, the prior art does not address the situation where the data processing rate is much lower than the data storing rate in the socket buffer to which a large amount of data is transmitted (due to a data processing policy not a physical processing rate). In this case, loading of the latest data, which may be more necessary, is delayed because the oldest data are loaded first.